/*
 * This project provides a number of implementations for indexing and evaluating
 * <i>Continuous Top-k Queries over Text Streams</i>
 * and has been developped as part of the work described in the article:
 * 
 * Vouzoukidou, N., Amann, B., & Christophides, V. (2012, October). 
 * Processing continuous text queries featuring non-homogeneous scoring functions.
 * In Proceedings of the 21st ACM international conference on Information and 
 * knowledge management (pp. 1065-1074). ACM.
 * http://dl.acm.org/citation.cfm?id=2398404
 * 
 * This software is distributed under the GNU General Public License and as an
 * additional condition of usage, please cite the aforementioned article.
 * 
 * Copyright (C) 2012 ICS/FORTH, Greece and 
 *               2012 LIP6, France
 * 
 * Author: Vouzoukidou Nelly, email: nelly.vouzoukidou (at) gmail (dot) com
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package gr.forth.ics.continuoustopk.index;

/**
 * This class provides static methods creating new objects of provided 
 * {@link QueryIndex} implementations.
 * 
 * @author Vouzoukidou Nelly, email: nelly.vouzoukidou (at) gmail (dot) com
 */
public class QueryIndexes {
    private QueryIndexes() {}
    
    /**
     * The COL-Filter implementation as presented in
     * http://dl.acm.org/citation.cfm?id=1871502
     * 
     * @return a new instance of {@link QueryIndex}
     */
    public static ColFilterQueryIndex colFilter() {
        return new ColFilterQueryIndex();
    }
    
    /**
     * An index considering only the second linear condition (MQW)
     * 
     * @return a new instance of {@link QueryIndex}
     */
    public static ConstantAngleOrderingQueryIndex constantAngleOrdering() {
        return new ConstantAngleOrderingQueryIndex();
    }

    /**
     * The {@code RectGrid} solution as presented in
     * http://dl.acm.org/citation.cfm?id=2398404
     * 
     * @param lines the number of lines of the index
     * @param columns the number of columns of the index
     * 
     * @return a new instance of {@link QueryIndex}
     */
    public static BucketsQueryIndex rectangularGrid(int lines, int columns) {
        return new BucketsQueryIndex(lines, columns, 0, BucketsQueryIndex.LineStrategy.rectangularGrid);
    }
    
    /**
     * The {@code SortBuck} solution as presented in
     * http://dl.acm.org/citation.cfm?id=2398404
     * 
     * @param lines the number of lines of the index
     * @param columns the number of columns of the index
     * 
     * @return a new instance of {@link QueryIndex}
     */
    public static BucketsQueryIndex sortedBuckets(int lines, int columns) {
        return new BucketsQueryIndex(lines, columns, 0, BucketsQueryIndex.LineStrategy.sortedBuckets);
    }
    
    /**
     * The {@code SortQuer} solution as presented in
     * http://dl.acm.org/citation.cfm?id=2398404
     * 
     * @param lines the number of lines of the index
     * 
     * @return a new instance of {@link QueryIndex}
     */
    public static BucketsQueryIndex sortedQueries(int lines) {
        return new BucketsQueryIndex(lines, 0, 0, BucketsQueryIndex.LineStrategy.sortedQueries);
    }
    
    /**
     * The {@code DensBuck} solution as presented in
     * http://dl.acm.org/citation.cfm?id=2398404
     * 
     * @param lines the number of lines of the index
     * @param bucketsDensity the density of the buckets
     * 
     * @return a new instance of {@link QueryIndex}
     */
    public static BucketsQueryIndex densityBuckets(int lines, int bucketsDensity) {
        return new BucketsQueryIndex(lines, 0, bucketsDensity, BucketsQueryIndex.LineStrategy.densityBuckets);
    }
    
    /**
     * A baseline solution which maintains an unordered inverted list for every 
     * term of the queries vocabulary. (Only for testing/comparison purposes).
     * 
     * @return a new instance of {@link QueryIndex}
     */
    public static SimpleQueryIndex simple() {
        return new SimpleQueryIndex();
    }
}
